package exam.controller;

import com.alibaba.fastjson.JSONObject;
import exam.service.LocalDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Xiongx
 * @version 1.0
 * @date 2021/3/31 12:53
 * @since JDK 1.8
 *
 * 本地数据处理
 */
@RestController
@Api("本地数据处理")
public class LocalDataController {

    @Autowired
    private LocalDataService localDataService;

    @GetMapping("getList")
    @ApiOperation("数据文件列表")
    public JSONObject getJSONController(){
        JSONObject jsonObject=new JSONObject();

        List<String> stringList=localDataService.getFileListPath();
        jsonObject.put("code",0);
        jsonObject.put("msg","success");
        jsonObject.put("data",stringList);
        return jsonObject;
    }


}
